home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Views / Standard Views / StringView.h < prev    next >
Text File  |  1997-06-28  |  1KB  |  66 lines

  1. // StringView.h
  2.  
  3. #ifndef StringView_h
  4. #define StringView_h
  5.  
  6. #ifndef View_h
  7. #include "View.h"
  8. #endif
  9. #ifndef HasForegroundColor_h
  10. #include "HasForegroundColor.h"
  11. #endif
  12. #ifndef HasBackgroundColor_h
  13. #include "HasBackgroundColor.h"
  14. #endif
  15. #ifndef HasFace_h
  16. #include "HasFace.h"
  17. #endif
  18. #ifndef HasVerticalJustification_h
  19. #include "HasVerticalJustification.h"
  20. #endif
  21. #ifndef HasHorizontalJustification_h
  22. #include "HasHorizontalJustification.h"
  23. #endif
  24. #ifndef Str_h
  25. #include "Str.h"
  26. #endif
  27.  
  28. class StringView: public View,
  29.                         public HasForegroundColor,
  30.                         public HasBackgroundColor,
  31.                         public HasFace,
  32.                         public HasVerticalJustification,
  33.                         public HasHorizontalJustification
  34.   {
  35.     private:
  36.         String255 string;
  37.     
  38.     protected:
  39.         virtual void ForegroundColorChanged();
  40.         virtual void BackgroundColorChanged();
  41.         virtual void FaceChanged();
  42.         virtual void VerticalJustificationChanged();
  43.         virtual void HorizontalJustificationChanged();
  44.         
  45.     public:
  46.         StringView( ::Face );
  47.         
  48.         virtual void Draw( const ViewMap& ) const;
  49.         
  50.         ConstPString String() const        { return string; }
  51.         void SetString( ConstPString );
  52.  
  53.         void Clear()                            { SetString( ConstPString( "\p" ) ); }
  54.         
  55.         virtual uint16 MinimumHeight() const;
  56.         
  57.         virtual uint16 ReasonableWidth() const;
  58.         
  59.         virtual uint16 BestWidth() const;
  60.         virtual uint16 BestHeight() const;
  61.         
  62.         uint16 WidthOf( ConstPString ) const;
  63.   };
  64.  
  65. #endif
  66.